<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qpainterpath.cpp -->
  <title>QPainterPath Class | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QPainterPath</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#composing-a-qpainterpath">Composing a QPainterPath</a></li>
<li class="level2"><a href="#qpainterpath-information">QPainterPath Information</a></li>
<li class="level2"><a href="#qpainterpath-conversion">QPainterPath Conversion</a></li>
<li class="level2"><a href="#examples">Examples</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QPainterPath Class</h1>
<!-- $$$QPainterPath-brief -->
<p>The QPainterPath class provides a container for painting operations, enabling graphical shapes to be constructed and reused. <a href="#details">More...</a></p>
<!-- @@@QPainterPath -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QPainterPath&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr></table></div><ul>
<li><a href="qpainterpath-members.html">List of all members, including inherited members</a></li>
<li><a href="qpainterpath-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath-element.html">Element</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#ElementType-enum">ElementType</a></b> { MoveToElement, LineToElement, CurveToElement, CurveToDataElement }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#QPainterPath-2">QPainterPath</a></b>(const QPainterPath &amp;<i>path</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#QPainterPath-1">QPainterPath</a></b>(const QPointF &amp;<i>startPoint</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#QPainterPath">QPainterPath</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath &amp;</td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-eq-1">operator=</a></b>(QPainterPath &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath &amp;</td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-eq">operator=</a></b>(const QPainterPath &amp;<i>path</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#dtor.QPainterPath">~QPainterPath</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addEllipse">addEllipse</a></b>(const QRectF &amp;<i>boundingRectangle</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addEllipse-1">addEllipse</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addEllipse-2">addEllipse</a></b>(const QPointF &amp;<i>center</i>, qreal <i>rx</i>, qreal <i>ry</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addPath">addPath</a></b>(const QPainterPath &amp;<i>path</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addPolygon">addPolygon</a></b>(const QPolygonF &amp;<i>polygon</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addRect">addRect</a></b>(const QRectF &amp;<i>rectangle</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addRect-1">addRect</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addRegion">addRegion</a></b>(const QRegion &amp;<i>region</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addRoundedRect">addRoundedRect</a></b>(const QRectF &amp;<i>rect</i>, qreal <i>xRadius</i>, qreal <i>yRadius</i>, Qt::SizeMode <i>mode</i> = Qt::AbsoluteSize)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addRoundedRect-1">addRoundedRect</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>, qreal <i>xRadius</i>, qreal <i>yRadius</i>, Qt::SizeMode <i>mode</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addText">addText</a></b>(const QPointF &amp;<i>point</i>, const QFont &amp;<i>font</i>, const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#addText-1">addText</a></b>(qreal <i>x</i>, qreal <i>y</i>, const QFont &amp;<i>font</i>, const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#angleAtPercent">angleAtPercent</a></b>(qreal <i>t</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#arcMoveTo">arcMoveTo</a></b>(const QRectF &amp;<i>rectangle</i>, qreal <i>angle</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#arcMoveTo-1">arcMoveTo</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i>, qreal <i>angle</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#arcTo">arcTo</a></b>(const QRectF &amp;<i>rectangle</i>, qreal <i>startAngle</i>, qreal <i>sweepLength</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#arcTo-1">arcTo</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i>, qreal <i>startAngle</i>, qreal <i>sweepLength</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#boundingRect">boundingRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#capacity">capacity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#closeSubpath">closeSubpath</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#connectPath">connectPath</a></b>(const QPainterPath &amp;<i>path</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#contains">contains</a></b>(const QPointF &amp;<i>point</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#contains-1">contains</a></b>(const QRectF &amp;<i>rectangle</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#contains-2">contains</a></b>(const QPainterPath &amp;<i>p</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#controlPointRect">controlPointRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#cubicTo">cubicTo</a></b>(const QPointF &amp;<i>c1</i>, const QPointF &amp;<i>c2</i>, const QPointF &amp;<i>endPoint</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#cubicTo-1">cubicTo</a></b>(qreal <i>c1X</i>, qreal <i>c1Y</i>, qreal <i>c2X</i>, qreal <i>c2Y</i>, qreal <i>endPointX</i>, qreal <i>endPointY</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#currentPosition">currentPosition</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath::Element </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#elementAt">elementAt</a></b>(int <i>index</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#elementCount">elementCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::FillRule </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#fillRule">fillRule</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#intersected">intersected</a></b>(const QPainterPath &amp;<i>p</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#intersects">intersects</a></b>(const QRectF &amp;<i>rectangle</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#intersects-1">intersects</a></b>(const QPainterPath &amp;<i>p</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#isEmpty">isEmpty</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#length">length</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#lineTo">lineTo</a></b>(const QPointF &amp;<i>endPoint</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#lineTo-1">lineTo</a></b>(qreal <i>x</i>, qreal <i>y</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#moveTo">moveTo</a></b>(const QPointF &amp;<i>point</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#moveTo-1">moveTo</a></b>(qreal <i>x</i>, qreal <i>y</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#percentAtLength">percentAtLength</a></b>(qreal <i>len</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#pointAtPercent">pointAtPercent</a></b>(qreal <i>t</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#quadTo">quadTo</a></b>(const QPointF &amp;<i>c</i>, const QPointF &amp;<i>endPoint</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#quadTo-1">quadTo</a></b>(qreal <i>cx</i>, qreal <i>cy</i>, qreal <i>endPointX</i>, qreal <i>endPointY</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#reserve">reserve</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#setElementPositionAt">setElementPositionAt</a></b>(int <i>index</i>, qreal <i>x</i>, qreal <i>y</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#setFillRule">setFillRule</a></b>(Qt::FillRule <i>fillRule</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#simplified">simplified</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#slopeAtPercent">slopeAtPercent</a></b>(qreal <i>t</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#subtracted">subtracted</a></b>(const QPainterPath &amp;<i>p</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#swap">swap</a></b>(QPainterPath &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#toFillPolygon">toFillPolygon</a></b>(const QTransform &amp;<i>matrix</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#toFillPolygon-1">toFillPolygon</a></b>(const QMatrix &amp;<i>matrix</i> = QMatrix()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QPolygonF&gt; </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#toFillPolygons">toFillPolygons</a></b>(const QTransform &amp;<i>matrix</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QPolygonF&gt; </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#toFillPolygons-1">toFillPolygons</a></b>(const QMatrix &amp;<i>matrix</i> = QMatrix()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#toReversed">toReversed</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QPolygonF&gt; </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#toSubpathPolygons">toSubpathPolygons</a></b>(const QTransform &amp;<i>matrix</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QPolygonF&gt; </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#toSubpathPolygons-1">toSubpathPolygons</a></b>(const QMatrix &amp;<i>matrix</i> = QMatrix()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#translate">translate</a></b>(qreal <i>dx</i>, qreal <i>dy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#translate-1">translate</a></b>(const QPointF &amp;<i>offset</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#translated">translated</a></b>(qreal <i>dx</i>, qreal <i>dy</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#translated-1">translated</a></b>(const QPointF &amp;<i>offset</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#united">united</a></b>(const QPainterPath &amp;<i>p</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-not-eq">operator!=</a></b>(const QPainterPath &amp;<i>path</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-and">operator&amp;</a></b>(const QPainterPath &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath &amp;</td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-and-eq">operator&amp;=</a></b>(const QPainterPath &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-2b">operator+</a></b>(const QPainterPath &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath &amp;</td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-2b-eq">operator+=</a></b>(const QPainterPath &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-">operator-</a></b>(const QPainterPath &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath &amp;</td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator--eq">operator-=</a></b>(const QPainterPath &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-eq-eq">operator==</a></b>(const QPainterPath &amp;<i>path</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-7c">operator|</a></b>(const QPainterPath &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath &amp;</td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-7c-eq">operator|=</a></b>(const QPainterPath &amp;<i>other</i>)</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-lt-lt-19">operator&lt;&lt;</a></b>(QDataStream &amp;<i>stream</i>, const QPainterPath &amp;<i>path</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qpainterpath.html#operator-gt-gt">operator&gt;&gt;</a></b>(QDataStream &amp;<i>stream</i>, QPainterPath &amp;<i>path</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QPainterPath-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>A painter path is an object composed of a number of graphical building blocks, such as rectangles, ellipses, lines, and curves. Building blocks can be joined in closed subpaths, for example as a rectangle or an ellipse. A closed path has coinciding start and end points. Or they can exist independently as unclosed subpaths, such as lines and curves.</p>
<p>A QPainterPath object can be used for filling, outlining, and clipping. To generate fillable outlines for a given painter path, use the <a href="qpainterpathstroker.html">QPainterPathStroker</a> class. The main advantage of painter paths over normal drawing operations is that complex shapes only need to be created once; then they can be drawn many times using only calls to the <a href="qpainter.html#drawPath">QPainter::drawPath</a>() function.</p>
<p>QPainterPath provides a collection of functions that can be used to obtain information about the path and its elements. In addition it is possible to reverse the order of the elements using the <a href="qpainterpath.html#toReversed">toReversed</a>() function. There are also several functions to convert this painter path object into a polygon representation.</p>
<a name="composing-a-qpainterpath"></a>
<h3 id="composing-a-qpainterpath">Composing a QPainterPath</h3>
<p>A QPainterPath object can be constructed as an empty path, with a given start point, or as a copy of another QPainterPath object. Once created, lines and curves can be added to the path using the <a href="qpainterpath.html#lineTo">lineTo</a>(), <a href="qpainterpath.html#arcTo">arcTo</a>(), <a href="qpainterpath.html#cubicTo">cubicTo</a>() and <a href="qpainterpath.html#quadTo">quadTo</a>() functions. The lines and curves stretch from the <a href="qpainterpath.html#currentPosition">currentPosition</a>() to the position passed as argument.</p>
<p>The <a href="qpainterpath.html#currentPosition">currentPosition</a>() of the QPainterPath object is always the end position of the last subpath that was added (or the initial start point). Use the <a href="qpainterpath.html#moveTo">moveTo</a>() function to move the <a href="qpainterpath.html#currentPosition">currentPosition</a>() without adding a component. The <a href="qpainterpath.html#moveTo">moveTo</a>() function implicitly starts a new subpath, and closes the previous one. Another way of starting a new subpath is to call the <a href="qpainterpath.html#closeSubpath">closeSubpath</a>() function which closes the current path by adding a line from the <a href="qpainterpath.html#currentPosition">currentPosition</a>() back to the path's start position. Note that the new path will have (0, 0) as its initial <a href="qpainterpath.html#currentPosition">currentPosition</a>().</p>
<p>QPainterPath class also provides several convenience functions to add closed subpaths to a painter path: <a href="qpainterpath.html#addEllipse">addEllipse</a>(), <a href="qpainterpath.html#addPath">addPath</a>(), <a href="qpainterpath.html#addRect">addRect</a>(), <a href="qpainterpath.html#addRegion">addRegion</a>() and <a href="qpainterpath.html#addText">addText</a>(). The <a href="qpainterpath.html#addPolygon">addPolygon</a>() function adds an <i>unclosed</i> subpath. In fact, these functions are all collections of <a href="qpainterpath.html#moveTo">moveTo</a>(), <a href="qpainterpath.html#lineTo">lineTo</a>() and <a href="qpainterpath.html#cubicTo">cubicTo</a>() operations.</p>
<p>In addition, a path can be added to the current path using the <a href="qpainterpath.html#connectPath">connectPath</a>() function. But note that this function will connect the last element of the current path to the first element of given one by adding a line.</p>
<p>Below is a code snippet that shows how a QPainterPath object can be used:</p>
<div class="table"><table class="generic" width="70%">
 <tr valign="top" class="odd"><td ><img src="images/qpainterpath-construction.png" alt="" /></td><td ><pre class="cpp">

  <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> path;
  path<span class="operator">.</span>addRect(<span class="number">20</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">60</span><span class="operator">,</span> <span class="number">60</span>);

  path<span class="operator">.</span>moveTo(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>);
  path<span class="operator">.</span>cubicTo(<span class="number">99</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span>  <span class="number">50</span><span class="operator">,</span> <span class="number">50</span><span class="operator">,</span>  <span class="number">99</span><span class="operator">,</span> <span class="number">99</span>);
  path<span class="operator">.</span>cubicTo(<span class="number">0</span><span class="operator">,</span> <span class="number">99</span><span class="operator">,</span>  <span class="number">50</span><span class="operator">,</span> <span class="number">50</span><span class="operator">,</span>  <span class="number">0</span><span class="operator">,</span> <span class="number">0</span>);

  <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
  painter<span class="operator">.</span>fillRect(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">100</span><span class="operator">,</span> <span class="number">100</span><span class="operator">,</span> <span class="type">Qt</span><span class="operator">::</span>white);
  painter<span class="operator">.</span>setPen(<span class="type"><a href="qpen.html">QPen</a></span>(<span class="type"><a href="qcolor.html">QColor</a></span>(<span class="number">79</span><span class="operator">,</span> <span class="number">106</span><span class="operator">,</span> <span class="number">25</span>)<span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="type">Qt</span><span class="operator">::</span>SolidLine<span class="operator">,</span>
                      <span class="type">Qt</span><span class="operator">::</span>FlatCap<span class="operator">,</span> <span class="type">Qt</span><span class="operator">::</span>MiterJoin));
  painter<span class="operator">.</span>setBrush(<span class="type"><a href="qcolor.html">QColor</a></span>(<span class="number">122</span><span class="operator">,</span> <span class="number">163</span><span class="operator">,</span> <span class="number">39</span>));

  painter<span class="operator">.</span>drawPath(path);

</pre>
</td></tr>
</table></div>
<p>The painter path is initially empty when constructed. We first add a rectangle, which is a closed subpath. Then we add two bezier curves which together form a closed subpath even though they are not closed individually. Finally we draw the entire path. The path is filled using the default fill rule, <a href="../qtcore/qt.html#FillRule-enum">Qt::OddEvenFill</a>. Qt provides two methods for filling paths:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th ><a href="../qtcore/qt.html#FillRule-enum">Qt::OddEvenFill</a></th><th ><a href="../qtcore/qt.html#FillRule-enum">Qt::WindingFill</a></th></tr></thead>
<tr valign="top" class="odd"><td ><img src="images/qt-fillrule-oddeven.png" alt="" /></td><td ><img src="images/qt-fillrule-winding.png" alt="" /></td></tr>
</table></div>
<p>See the <a href="../qtcore/qt.html#FillRule-enum">Qt::FillRule</a> documentation for the definition of the rules. A painter path's currently set fill rule can be retrieved using the <a href="qpainterpath.html#fillRule">fillRule</a>() function, and altered using the <a href="qpainterpath.html#setFillRule">setFillRule</a>() function.</p>
<a name="qpainterpath-information"></a>
<h3 id="qpainterpath-information">QPainterPath Information</h3>
<p>The QPainterPath class provides a collection of functions that returns information about the path and its elements.</p>
<p>The <a href="qpainterpath.html#currentPosition">currentPosition</a>() function returns the end point of the last subpath that was added (or the initial start point). The <a href="qpainterpath.html#elementAt">elementAt</a>() function can be used to retrieve the various subpath elements, the <i>number</i> of elements can be retrieved using the <a href="qpainterpath.html#elementCount">elementCount</a>() function, and the <a href="qpainterpath.html#isEmpty">isEmpty</a>() function tells whether this QPainterPath object contains any elements at all.</p>
<p>The <a href="qpainterpath.html#controlPointRect">controlPointRect</a>() function returns the rectangle containing all the points and control points in this path. This function is significantly faster to compute than the exact <a href="qpainterpath.html#boundingRect">boundingRect</a>() which returns the bounding rectangle of this painter path with floating point precision.</p>
<p>Finally, QPainterPath provides the <a href="qpainterpath.html#contains">contains</a>() function which can be used to determine whether a given point or rectangle is inside the path, and the <a href="qpainterpath.html#intersects">intersects</a>() function which determines if any of the points inside a given rectangle also are inside this path.</p>
<a name="qpainterpath-conversion"></a>
<h3 id="qpainterpath-conversion">QPainterPath Conversion</h3>
<p>For compatibility reasons, it might be required to simplify the representation of a painter path: QPainterPath provides the <a href="qpainterpath.html#toFillPolygon">toFillPolygon</a>(), <a href="qpainterpath.html#toFillPolygons">toFillPolygons</a>() and <a href="qpainterpath.html#toSubpathPolygons">toSubpathPolygons</a>() functions which convert the painter path into a polygon. The <a href="qpainterpath.html#toFillPolygon">toFillPolygon</a>() returns the painter path as one single polygon, while the two latter functions return a list of polygons.</p>
<p>The <a href="qpainterpath.html#toFillPolygons">toFillPolygons</a>() and <a href="qpainterpath.html#toSubpathPolygons">toSubpathPolygons</a>() functions are provided because it is usually faster to draw several small polygons than to draw one large polygon, even though the total number of points drawn is the same. The difference between the two is the <i>number</i> of polygons they return: The <a href="qpainterpath.html#toSubpathPolygons">toSubpathPolygons</a>() creates one polygon for each subpath regardless of intersecting subpaths (i.e&#x2e; overlapping bounding rectangles), while the <a href="qpainterpath.html#toFillPolygons">toFillPolygons</a>() functions creates only one polygon for overlapping subpaths.</p>
<p>The <a href="qpainterpath.html#toFillPolygon">toFillPolygon</a>() and <a href="qpainterpath.html#toFillPolygons">toFillPolygons</a>() functions first convert all the subpaths to polygons, then uses a rewinding technique to make sure that overlapping subpaths can be filled using the correct fill rule. Note that rewinding inserts additional lines in the polygon so the outline of the fill polygon does not match the outline of the path.</p>
<a name="examples"></a>
<h3 id="examples">Examples</h3>
<p>Qt provides the <a href="../qtwidgets/qtwidgets-painting-painterpaths-example.html">Painter Paths Example</a> and the <a href="../qtwidgets/qtwidgets-painting-deform-example.html">Vector Deformation example</a> which are located in Qt's example directory.</p>
<p>The <a href="../qtwidgets/qtwidgets-painting-painterpaths-example.html">Painter Paths Example</a> shows how painter paths can be used to build complex shapes for rendering and lets the user experiment with the filling and stroking. The <a href="../qtwidgets/qtwidgets-painting-deform-example.html">Vector Deformation Example</a> shows how to use QPainterPath to draw text.</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th ><a href="../qtwidgets/qtwidgets-painting-painterpaths-example.html">Painter Paths Example</a></th><th ><a href="../qtwidgets/qtwidgets-painting-deform-example.html">Vector Deformation Example</a></th></tr></thead>
<tr valign="top" class="odd"><td ><img src="images/qpainterpath-example.png" alt="" /></td><td ><img src="images/qpainterpath-demo.png" alt="" /></td></tr>
</table></div>
</div>
<p><b>See also </b><a href="qpainterpathstroker.html">QPainterPathStroker</a>, <a href="qpainter.html">QPainter</a>, <a href="qregion.html">QRegion</a>, and <a href="../qtwidgets/qtwidgets-painting-painterpaths-example.html">Painter Paths Example</a>.</p>
<!-- @@@QPainterPath -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ElementType$$$MoveToElement$$$LineToElement$$$CurveToElement$$$CurveToDataElement -->
<h3 class="fn" id="ElementType-enum"><a name="ElementType-enum"></a>enum QPainterPath::<span class="name">ElementType</span></h3>
<p>This enum describes the types of elements used to connect vertices in subpaths.</p>
<p>Note that elements added as closed subpaths using the <a href="qpainterpath.html#addEllipse">addEllipse</a>(), <a href="qpainterpath.html#addPath">addPath</a>(), <a href="qpainterpath.html#addPolygon">addPolygon</a>(), <a href="qpainterpath.html#addRect">addRect</a>(), <a href="qpainterpath.html#addRegion">addRegion</a>() and <a href="qpainterpath.html#addText">addText</a>() convenience functions, is actually added to the path as a collection of separate elements using the <a href="qpainterpath.html#moveTo">moveTo</a>(), <a href="qpainterpath.html#lineTo">lineTo</a>() and <a href="qpainterpath.html#cubicTo">cubicTo</a>() functions.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QPainterPath::MoveToElement</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">A new subpath. See also <a href="qpainterpath.html#moveTo">moveTo</a>().</td></tr>
<tr><td class="topAlign"><code>QPainterPath::LineToElement</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">A line. See also <a href="qpainterpath.html#lineTo">lineTo</a>().</td></tr>
<tr><td class="topAlign"><code>QPainterPath::CurveToElement</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">A curve. See also <a href="qpainterpath.html#cubicTo">cubicTo</a>() and <a href="qpainterpath.html#quadTo">quadTo</a>().</td></tr>
<tr><td class="topAlign"><code>QPainterPath::CurveToDataElement</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The extra data required to describe a curve in a CurveToElement element.</td></tr>
</table></div>
<p><b>See also </b><a href="qpainterpath.html#elementAt">elementAt</a>() and <a href="qpainterpath.html#elementCount">elementCount</a>().</p>
<!-- @@@ElementType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPainterPath$$$QPainterPathconstQPainterPath& -->
<h3 class="fn" id="QPainterPath-2"><a name="QPainterPath-2"></a>QPainterPath::<span class="name">QPainterPath</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>path</i>)</h3>
<p>Creates a QPainterPath object that is a copy of the given <i>path</i>.</p>
<p><b>See also </b><a href="qpainterpath.html#operator-eq">operator=</a>().</p>
<!-- @@@QPainterPath -->
<!-- $$$QPainterPath$$$QPainterPathconstQPointF& -->
<h3 class="fn" id="QPainterPath-1"><a name="QPainterPath-1"></a>QPainterPath::<span class="name">QPainterPath</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>startPoint</i>)</h3>
<p>Creates a QPainterPath object with the given <i>startPoint</i> as its current position.</p>
<!-- @@@QPainterPath -->
<!-- $$$QPainterPath[overload1]$$$QPainterPath -->
<h3 class="fn" id="QPainterPath"><a name="QPainterPath"></a>QPainterPath::<span class="name">QPainterPath</span>()</h3>
<p>Constructs an empty QPainterPath object.</p>
<!-- @@@QPainterPath -->
<!-- $$$operator=$$$operator=QPainterPath&& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;QPainterPath::<span class="name">operator=</span>(<span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-assigns <i>other</i> to this <a href="qpainterpath.html">QPainterPath</a> instance.</p>
<p>This function was introduced in Qt 5.2.</p>
<!-- @@@operator= -->
<!-- $$$operator=[overload1]$$$operator=constQPainterPath& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;QPainterPath::<span class="name">operator=</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>path</i>)</h3>
<p>Assigns the given <i>path</i> to this painter path.</p>
<p><b>See also </b><a href="qpainterpath.html#QPainterPath">QPainterPath</a>().</p>
<!-- @@@operator= -->
<!-- $$$~QPainterPath[overload1]$$$~QPainterPath -->
<h3 class="fn" id="dtor.QPainterPath"><a name="dtor.QPainterPath"></a>QPainterPath::<span class="name">~QPainterPath</span>()</h3>
<p>Destroys this <a href="qpainterpath.html">QPainterPath</a> object.</p>
<!-- @@@~QPainterPath -->
<!-- $$$addEllipse[overload1]$$$addEllipseconstQRectF& -->
<h3 class="fn" id="addEllipse"><a name="addEllipse"></a><span class="type">void</span> QPainterPath::<span class="name">addEllipse</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>boundingRectangle</i>)</h3>
<p>Creates an ellipse within the specified <i>boundingRectangle</i> and adds it to the painter path as a closed subpath.</p>
<p>The ellipse is composed of a clockwise curve, starting and finishing at zero degrees (the 3 o'clock position).</p>
<div class="table"><table class="generic" width="100%">
 <tr valign="top" class="odd"><td ><img src="images/qpainterpath-addellipse.png" alt="" /></td><td ><pre class="cpp">

  <span class="type"><a href="qlineargradient.html">QLinearGradient</a></span> myGradient;
  <span class="type"><a href="qpen.html">QPen</a></span> myPen;
  <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> boundingRectangle;

  <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> myPath;
  myPath<span class="operator">.</span>addEllipse(boundingRectangle);

  <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
  painter<span class="operator">.</span>setBrush(myGradient);
  painter<span class="operator">.</span>setPen(myPen);
  painter<span class="operator">.</span>drawPath(myPath);

</pre>
</td></tr>
</table></div>
<p><b>See also </b><a href="qpainterpath.html#arcTo">arcTo</a>(), <a href="qpainter.html#drawEllipse">QPainter::drawEllipse</a>(), and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@addEllipse -->
<!-- $$$addEllipse$$$addEllipseqrealqrealqrealqreal -->
<h3 class="fn" id="addEllipse-1"><a name="addEllipse-1"></a><span class="type">void</span> QPainterPath::<span class="name">addEllipse</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i>)</h3>
<p>This is an overloaded function.</p>
<p>Creates an ellipse within the bounding rectangle defined by its top-left corner at (<i>x</i>, <i>y</i>), <i>width</i> and <i>height</i>, and adds it to the painter path as a closed subpath.</p>
<!-- @@@addEllipse -->
<!-- $$$addEllipse$$$addEllipseconstQPointF&qrealqreal -->
<h3 class="fn" id="addEllipse-2"><a name="addEllipse-2"></a><span class="type">void</span> QPainterPath::<span class="name">addEllipse</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>center</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>rx</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>ry</i>)</h3>
<p>This is an overloaded function.</p>
<p>Creates an ellipse positioned at <i>center</i> with radii <i>rx</i> and <i>ry</i>, and adds it to the painter path as a closed subpath.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@addEllipse -->
<!-- $$$addPath[overload1]$$$addPathconstQPainterPath& -->
<h3 class="fn" id="addPath"><a name="addPath"></a><span class="type">void</span> QPainterPath::<span class="name">addPath</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>path</i>)</h3>
<p>Adds the given <i>path</i> to <i>this</i> path as a closed subpath.</p>
<p><b>See also </b><a href="qpainterpath.html#connectPath">connectPath</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@addPath -->
<!-- $$$addPolygon[overload1]$$$addPolygonconstQPolygonF& -->
<h3 class="fn" id="addPolygon"><a name="addPolygon"></a><span class="type">void</span> QPainterPath::<span class="name">addPolygon</span>(const <span class="type"><a href="qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>)</h3>
<p>Adds the given <i>polygon</i> to the path as an (unclosed) subpath.</p>
<p>Note that the current position after the polygon has been added, is the last point in <i>polygon</i>. To draw a line back to the first point, use the <a href="qpainterpath.html#closeSubpath">closeSubpath</a>() function.</p>
<div class="table"><table class="generic" width="100%">
 <tr valign="top" class="odd"><td ><img src="images/qpainterpath-addpolygon.png" alt="" /></td><td ><pre class="cpp">

  <span class="type"><a href="qlineargradient.html">QLinearGradient</a></span> myGradient;
  <span class="type"><a href="qpen.html">QPen</a></span> myPen;
  <span class="type"><a href="qpolygonf.html">QPolygonF</a></span> myPolygon;

  <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> myPath;
  myPath<span class="operator">.</span>addPolygon(myPolygon);

  <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
  painter<span class="operator">.</span>setBrush(myGradient);
  painter<span class="operator">.</span>setPen(myPen);
  painter<span class="operator">.</span>drawPath(myPath);

</pre>
</td></tr>
</table></div>
<p><b>See also </b><a href="qpainterpath.html#lineTo">lineTo</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@addPolygon -->
<!-- $$$addRect[overload1]$$$addRectconstQRectF& -->
<h3 class="fn" id="addRect"><a name="addRect"></a><span class="type">void</span> QPainterPath::<span class="name">addRect</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rectangle</i>)</h3>
<p>Adds the given <i>rectangle</i> to this path as a closed subpath.</p>
<p>The <i>rectangle</i> is added as a clockwise set of lines. The painter path's current position after the <i>rectangle</i> has been added is at the top-left corner of the rectangle.</p>
<div class="table"><table class="generic" width="100%">
 <tr valign="top" class="odd"><td ><img src="images/qpainterpath-addrectangle.png" alt="" /></td><td ><pre class="cpp">

  <span class="type"><a href="qlineargradient.html">QLinearGradient</a></span> myGradient;
  <span class="type"><a href="qpen.html">QPen</a></span> myPen;
  <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> myRectangle;

  <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> myPath;
  myPath<span class="operator">.</span>addRect(myRectangle);

  <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
  painter<span class="operator">.</span>setBrush(myGradient);
  painter<span class="operator">.</span>setPen(myPen);
  painter<span class="operator">.</span>drawPath(myPath);

</pre>
</td></tr>
</table></div>
<p><b>See also </b><a href="qpainterpath.html#addRegion">addRegion</a>(), <a href="qpainterpath.html#lineTo">lineTo</a>(), and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@addRect -->
<!-- $$$addRect$$$addRectqrealqrealqrealqreal -->
<h3 class="fn" id="addRect-1"><a name="addRect-1"></a><span class="type">void</span> QPainterPath::<span class="name">addRect</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i>)</h3>
<p>This is an overloaded function.</p>
<p>Adds a rectangle at position (<i>x</i>, <i>y</i>), with the given <i>width</i> and <i>height</i>, as a closed subpath.</p>
<!-- @@@addRect -->
<!-- $$$addRegion[overload1]$$$addRegionconstQRegion& -->
<h3 class="fn" id="addRegion"><a name="addRegion"></a><span class="type">void</span> QPainterPath::<span class="name">addRegion</span>(const <span class="type"><a href="qregion.html">QRegion</a></span> &amp;<i>region</i>)</h3>
<p>Adds the given <i>region</i> to the path by adding each rectangle in the region as a separate closed subpath.</p>
<p><b>See also </b><a href="qpainterpath.html#addRect">addRect</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@addRegion -->
<!-- $$$addRoundedRect[overload1]$$$addRoundedRectconstQRectF&qrealqrealQt::SizeMode -->
<h3 class="fn" id="addRoundedRect"><a name="addRoundedRect"></a><span class="type">void</span> QPainterPath::<span class="name">addRoundedRect</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>xRadius</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>yRadius</i>, <span class="type"><a href="../qtcore/qt.html#SizeMode-enum">Qt::SizeMode</a></span> <i>mode</i> = Qt::AbsoluteSize)</h3>
<p>Adds the given rectangle <i>rect</i> with rounded corners to the path.</p>
<p>The <i>xRadius</i> and <i>yRadius</i> arguments specify the radii of the ellipses defining the corners of the rounded rectangle. When <i>mode</i> is <a href="../qtcore/qt.html#SizeMode-enum">Qt::RelativeSize</a>, <i>xRadius</i> and <i>yRadius</i> are specified in percentage of half the rectangle's width and height respectively, and should be in the range 0.0 to 100.0&#x2e;</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qpainterpath.html#addRect">addRect</a>().</p>
<!-- @@@addRoundedRect -->
<!-- $$$addRoundedRect$$$addRoundedRectqrealqrealqrealqrealqrealqrealQt::SizeMode -->
<h3 class="fn" id="addRoundedRect-1"><a name="addRoundedRect-1"></a><span class="type">void</span> QPainterPath::<span class="name">addRoundedRect</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>xRadius</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>yRadius</i>, <span class="type"><a href="../qtcore/qt.html#SizeMode-enum">Qt::SizeMode</a></span> <i>mode</i> = ...)</h3>
<p>This is an overloaded function.</p>
<p>Adds the given rectangle <i>x</i>, <i>y</i>, <i>w</i>, <i>h</i> with rounded corners to the path.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@addRoundedRect -->
<!-- $$$addText[overload1]$$$addTextconstQPointF&constQFont&constQString& -->
<h3 class="fn" id="addText"><a name="addText"></a><span class="type">void</span> QPainterPath::<span class="name">addText</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>, const <span class="type"><a href="qfont.html">QFont</a></span> &amp;<i>font</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>Adds the given <i>text</i> to this path as a set of closed subpaths created from the <i>font</i> supplied. The subpaths are positioned so that the left end of the text's baseline lies at the specified <i>point</i>.</p>
<div class="table"><table class="generic" width="100%">
 <tr valign="top" class="odd"><td ><img src="images/qpainterpath-addtext.png" alt="" /></td><td ><pre class="cpp">

  <span class="type"><a href="qlineargradient.html">QLinearGradient</a></span> myGradient;
  <span class="type"><a href="qpen.html">QPen</a></span> myPen;
  <span class="type"><a href="qfont.html">QFont</a></span> myFont;
  <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> baseline(x<span class="operator">,</span> y);

  <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> myPath;
  myPath<span class="operator">.</span>addText(baseline<span class="operator">,</span> myFont<span class="operator">,</span> tr(<span class="string">&quot;Qt&quot;</span>));

  <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
  painter<span class="operator">.</span>setBrush(myGradient);
  painter<span class="operator">.</span>setPen(myPen);
  painter<span class="operator">.</span>drawPath(myPath);

</pre>
</td></tr>
</table></div>
<p><b>See also </b><a href="qpainter.html#drawText">QPainter::drawText</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@addText -->
<!-- $$$addText$$$addTextqrealqrealconstQFont&constQString& -->
<h3 class="fn" id="addText-1"><a name="addText-1"></a><span class="type">void</span> QPainterPath::<span class="name">addText</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, const <span class="type"><a href="qfont.html">QFont</a></span> &amp;<i>font</i>, const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>This is an overloaded function.</p>
<p>Adds the given <i>text</i> to this path as a set of closed subpaths created from the <i>font</i> supplied. The subpaths are positioned so that the left end of the text's baseline lies at the point specified by (<i>x</i>, <i>y</i>).</p>
<!-- @@@addText -->
<!-- $$$angleAtPercent[overload1]$$$angleAtPercentqreal -->
<h3 class="fn" id="angleAtPercent"><a name="angleAtPercent"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QPainterPath::<span class="name">angleAtPercent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>t</i>) const</h3>
<p>Returns the angle of the path tangent at the percentage <i>t</i>. The argument <i>t</i> has to be between 0 and 1.</p>
<p>Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.</p>
<p>Note that similarly to the other percent methods, the percentage measurement is not linear with regards to the length if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations.</p>
<!-- @@@angleAtPercent -->
<!-- $$$arcMoveTo[overload1]$$$arcMoveToconstQRectF&qreal -->
<h3 class="fn" id="arcMoveTo"><a name="arcMoveTo"></a><span class="type">void</span> QPainterPath::<span class="name">arcMoveTo</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rectangle</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>angle</i>)</h3>
<p>Creates a move to that lies on the arc that occupies the given <i>rectangle</i> at <i>angle</i>.</p>
<p>Angles are specified in degrees. Clockwise arcs can be specified using negative angles.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qpainterpath.html#moveTo">moveTo</a>() and <a href="qpainterpath.html#arcTo">arcTo</a>().</p>
<!-- @@@arcMoveTo -->
<!-- $$$arcMoveTo$$$arcMoveToqrealqrealqrealqrealqreal -->
<h3 class="fn" id="arcMoveTo-1"><a name="arcMoveTo-1"></a><span class="type">void</span> QPainterPath::<span class="name">arcMoveTo</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>angle</i>)</h3>
<p>This is an overloaded function.</p>
<p>Creates a move to that lies on the arc that occupies the <a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>width</i>, <i>height</i>) at <i>angle</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@arcMoveTo -->
<!-- $$$arcTo[overload1]$$$arcToconstQRectF&qrealqreal -->
<h3 class="fn" id="arcTo"><a name="arcTo"></a><span class="type">void</span> QPainterPath::<span class="name">arcTo</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rectangle</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>startAngle</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>sweepLength</i>)</h3>
<p>Creates an arc that occupies the given <i>rectangle</i>, beginning at the specified <i>startAngle</i> and extending <i>sweepLength</i> degrees counter-clockwise.</p>
<p>Angles are specified in degrees. Clockwise arcs can be specified using negative angles.</p>
<p>Note that this function connects the starting point of the arc to the current position if they are not already connected. After the arc has been added, the current position is the last point in arc. To draw a line back to the first point, use the <a href="qpainterpath.html#closeSubpath">closeSubpath</a>() function.</p>
<div class="table"><table class="generic" width="100%">
 <tr valign="top" class="odd"><td ><img src="images/qpainterpath-arcto.png" alt="" /></td><td ><pre class="cpp">

  <span class="type"><a href="qlineargradient.html">QLinearGradient</a></span> myGradient;
  <span class="type"><a href="qpen.html">QPen</a></span> myPen;

  <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> center<span class="operator">,</span> startPoint;

  <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> myPath;
  myPath<span class="operator">.</span>moveTo(center);
  myPath<span class="operator">.</span>arcTo(boundingRect<span class="operator">,</span> startAngle<span class="operator">,</span>
               sweepLength);

  <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
  painter<span class="operator">.</span>setBrush(myGradient);
  painter<span class="operator">.</span>setPen(myPen);
  painter<span class="operator">.</span>drawPath(myPath);

</pre>
</td></tr>
</table></div>
<p><b>See also </b><a href="qpainterpath.html#arcMoveTo">arcMoveTo</a>(), <a href="qpainterpath.html#addEllipse">addEllipse</a>(), <a href="qpainter.html#drawArc">QPainter::drawArc</a>(), <a href="qpainter.html#drawPie">QPainter::drawPie</a>(), and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@arcTo -->
<!-- $$$arcTo$$$arcToqrealqrealqrealqrealqrealqreal -->
<h3 class="fn" id="arcTo-1"><a name="arcTo-1"></a><span class="type">void</span> QPainterPath::<span class="name">arcTo</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>startAngle</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>sweepLength</i>)</h3>
<p>This is an overloaded function.</p>
<p>Creates an arc that occupies the rectangle <a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>width</i>, <i>height</i>), beginning at the specified <i>startAngle</i> and extending <i>sweepLength</i> degrees counter-clockwise.</p>
<!-- @@@arcTo -->
<!-- $$$boundingRect[overload1]$$$boundingRect -->
<h3 class="fn" id="boundingRect"><a name="boundingRect"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QPainterPath::<span class="name">boundingRect</span>() const</h3>
<p>Returns the bounding rectangle of this painter path as a rectangle with floating point precision.</p>
<p><b>See also </b><a href="qpainterpath.html#controlPointRect">controlPointRect</a>().</p>
<!-- @@@boundingRect -->
<!-- $$$capacity[overload1]$$$capacity -->
<h3 class="fn" id="capacity"><a name="capacity"></a><span class="type">int</span> QPainterPath::<span class="name">capacity</span>() const</h3>
<p>Returns the number of elements allocated by the <a href="qpainterpath.html">QPainterPath</a>.</p>
<p>This function was introduced in Qt 5.13.</p>
<p><b>See also </b><a href="qpainterpath.html#clear">clear</a>() and <a href="qpainterpath.html#reserve">reserve</a>().</p>
<!-- @@@capacity -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><span class="type">void</span> QPainterPath::<span class="name">clear</span>()</h3>
<p>Clears the path elements stored.</p>
<p>This allows the path to reuse previous memory allocations.</p>
<p>This function was introduced in Qt 5.13.</p>
<p><b>See also </b><a href="qpainterpath.html#reserve">reserve</a>() and <a href="qpainterpath.html#capacity">capacity</a>().</p>
<!-- @@@clear -->
<!-- $$$closeSubpath[overload1]$$$closeSubpath -->
<h3 class="fn" id="closeSubpath"><a name="closeSubpath"></a><span class="type">void</span> QPainterPath::<span class="name">closeSubpath</span>()</h3>
<p>Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting a new path. The current point of the new path is (0, 0).</p>
<p>If the subpath does not contain any elements, this function does nothing.</p>
<p><b>See also </b><a href="qpainterpath.html#moveTo">moveTo</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@closeSubpath -->
<!-- $$$connectPath[overload1]$$$connectPathconstQPainterPath& -->
<h3 class="fn" id="connectPath"><a name="connectPath"></a><span class="type">void</span> QPainterPath::<span class="name">connectPath</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>path</i>)</h3>
<p>Connects the given <i>path</i> to <i>this</i> path by adding a line from the last element of this path to the first element of the given path.</p>
<p><b>See also </b><a href="qpainterpath.html#addPath">addPath</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@connectPath -->
<!-- $$$contains[overload1]$$$containsconstQPointF& -->
<h3 class="fn" id="contains"><a name="contains"></a><span class="type">bool</span> QPainterPath::<span class="name">contains</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>) const</h3>
<p>Returns <code>true</code> if the given <i>point</i> is inside the path, otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qpainterpath.html#intersects">intersects</a>().</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsconstQRectF& -->
<h3 class="fn" id="contains-1"><a name="contains-1"></a><span class="type">bool</span> QPainterPath::<span class="name">contains</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rectangle</i>) const</h3>
<p>Returns <code>true</code> if the given <i>rectangle</i> is inside the path, otherwise returns <code>false</code>.</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsconstQPainterPath& -->
<h3 class="fn" id="contains-2"><a name="contains-2"></a><span class="type">bool</span> QPainterPath::<span class="name">contains</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>p</i>) const</h3>
<p>Returns <code>true</code> if the given path <i>p</i> is contained within the current path. Returns <code>false</code> if any edges of the current path and <i>p</i> intersect.</p>
<p>Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qpainterpath.html#intersects">intersects</a>().</p>
<!-- @@@contains -->
<!-- $$$controlPointRect[overload1]$$$controlPointRect -->
<h3 class="fn" id="controlPointRect"><a name="controlPointRect"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QPainterPath::<span class="name">controlPointRect</span>() const</h3>
<p>Returns the rectangle containing all the points and control points in this path.</p>
<p>This function is significantly faster to compute than the exact <a href="qpainterpath.html#boundingRect">boundingRect</a>(), and the returned rectangle is always a superset of the rectangle returned by <a href="qpainterpath.html#boundingRect">boundingRect</a>().</p>
<p><b>See also </b><a href="qpainterpath.html#boundingRect">boundingRect</a>().</p>
<!-- @@@controlPointRect -->
<!-- $$$cubicTo[overload1]$$$cubicToconstQPointF&constQPointF&constQPointF& -->
<h3 class="fn" id="cubicTo"><a name="cubicTo"></a><span class="type">void</span> QPainterPath::<span class="name">cubicTo</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>c1</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>c2</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>endPoint</i>)</h3>
<p>Adds a cubic Bezier curve between the current position and the given <i>endPoint</i> using the control points specified by <i>c1</i>, and <i>c2</i>.</p>
<p>After the curve is added, the current position is updated to be at the end point of the curve.</p>
<div class="table"><table class="generic" width="100%">
 <tr valign="top" class="odd"><td ><img src="images/qpainterpath-cubicto.png" alt="" /></td><td ><pre class="cpp">

  <span class="type"><a href="qlineargradient.html">QLinearGradient</a></span> myGradient;
  <span class="type"><a href="qpen.html">QPen</a></span> myPen;

  <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> myPath;
  myPath<span class="operator">.</span>cubicTo(c1<span class="operator">,</span> c2<span class="operator">,</span> endPoint);

  <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
  painter<span class="operator">.</span>setBrush(myGradient);
  painter<span class="operator">.</span>setPen(myPen);
  painter<span class="operator">.</span>drawPath(myPath);

</pre>
</td></tr>
</table></div>
<p><b>See also </b><a href="qpainterpath.html#quadTo">quadTo</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@cubicTo -->
<!-- $$$cubicTo$$$cubicToqrealqrealqrealqrealqrealqreal -->
<h3 class="fn" id="cubicTo-1"><a name="cubicTo-1"></a><span class="type">void</span> QPainterPath::<span class="name">cubicTo</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>c1X</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>c1Y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>c2X</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>c2Y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>endPointX</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>endPointY</i>)</h3>
<p>This is an overloaded function.</p>
<p>Adds a cubic Bezier curve between the current position and the end point (<i>endPointX</i>, <i>endPointY</i>) with control points specified by (<i>c1X</i>, <i>c1Y</i>) and (<i>c2X</i>, <i>c2Y</i>).</p>
<!-- @@@cubicTo -->
<!-- $$$currentPosition[overload1]$$$currentPosition -->
<h3 class="fn" id="currentPosition"><a name="currentPosition"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QPainterPath::<span class="name">currentPosition</span>() const</h3>
<p>Returns the current position of the path.</p>
<!-- @@@currentPosition -->
<!-- $$$elementAt[overload1]$$$elementAtint -->
<h3 class="fn" id="elementAt"><a name="elementAt"></a><span class="type"><a href="qpainterpath-element.html">QPainterPath::Element</a></span> QPainterPath::<span class="name">elementAt</span>(<span class="type">int</span> <i>index</i>) const</h3>
<p>Returns the element at the given <i>index</i> in the painter path.</p>
<p><b>See also </b><a href="qpainterpath.html#ElementType-enum">ElementType</a>, <a href="qpainterpath.html#elementCount">elementCount</a>(), and <a href="qpainterpath.html#isEmpty">isEmpty</a>().</p>
<!-- @@@elementAt -->
<!-- $$$elementCount[overload1]$$$elementCount -->
<h3 class="fn" id="elementCount"><a name="elementCount"></a><span class="type">int</span> QPainterPath::<span class="name">elementCount</span>() const</h3>
<p>Returns the number of path elements in the painter path.</p>
<p><b>See also </b><a href="qpainterpath.html#ElementType-enum">ElementType</a>, <a href="qpainterpath.html#elementAt">elementAt</a>(), and <a href="qpainterpath.html#isEmpty">isEmpty</a>().</p>
<!-- @@@elementCount -->
<!-- $$$fillRule[overload1]$$$fillRule -->
<h3 class="fn" id="fillRule"><a name="fillRule"></a><span class="type"><a href="../qtcore/qt.html#FillRule-enum">Qt::FillRule</a></span> QPainterPath::<span class="name">fillRule</span>() const</h3>
<p>Returns the painter path's currently set fill rule.</p>
<p><b>See also </b><a href="qpainterpath.html#setFillRule">setFillRule</a>().</p>
<!-- @@@fillRule -->
<!-- $$$intersected[overload1]$$$intersectedconstQPainterPath& -->
<h3 class="fn" id="intersected"><a name="intersected"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">intersected</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>p</i>) const</h3>
<p>Returns a path which is the intersection of this path's fill area and <i>p</i>'s fill area. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@intersected -->
<!-- $$$intersects[overload1]$$$intersectsconstQRectF& -->
<h3 class="fn" id="intersects"><a name="intersects"></a><span class="type">bool</span> QPainterPath::<span class="name">intersects</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rectangle</i>) const</h3>
<p>Returns <code>true</code> if any point in the given <i>rectangle</i> intersects the path; otherwise returns <code>false</code>.</p>
<p>There is an intersection if any of the lines making up the rectangle crosses a part of the path or if any part of the rectangle overlaps with any area enclosed by the path. This function respects the current <a href="qpainterpath.html#fillRule">fillRule</a> to determine what is considered inside the path.</p>
<p><b>See also </b><a href="qpainterpath.html#contains">contains</a>().</p>
<!-- @@@intersects -->
<!-- $$$intersects$$$intersectsconstQPainterPath& -->
<h3 class="fn" id="intersects-1"><a name="intersects-1"></a><span class="type">bool</span> QPainterPath::<span class="name">intersects</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>p</i>) const</h3>
<p>Returns <code>true</code> if the current path intersects at any point the given path <i>p</i>. Also returns <code>true</code> if the current path contains or is contained by any part of <i>p</i>.</p>
<p>Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qpainterpath.html#contains">contains</a>().</p>
<!-- @@@intersects -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn" id="isEmpty"><a name="isEmpty"></a><span class="type">bool</span> QPainterPath::<span class="name">isEmpty</span>() const</h3>
<p>Returns <code>true</code> if either there are no elements in this path, or if the only element is a <a href="qpainterpath.html#ElementType-enum">MoveToElement</a>; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qpainterpath.html#elementCount">elementCount</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$length[overload1]$$$length -->
<h3 class="fn" id="length"><a name="length"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QPainterPath::<span class="name">length</span>() const</h3>
<p>Returns the length of the current path.</p>
<!-- @@@length -->
<!-- $$$lineTo[overload1]$$$lineToconstQPointF& -->
<h3 class="fn" id="lineTo"><a name="lineTo"></a><span class="type">void</span> QPainterPath::<span class="name">lineTo</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>endPoint</i>)</h3>
<p>Adds a straight line from the current position to the given <i>endPoint</i>. After the line is drawn, the current position is updated to be at the end point of the line.</p>
<p><b>See also </b><a href="qpainterpath.html#addPolygon">addPolygon</a>(), <a href="qpainterpath.html#addRect">addRect</a>(), and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@lineTo -->
<!-- $$$lineTo$$$lineToqrealqreal -->
<h3 class="fn" id="lineTo-1"><a name="lineTo-1"></a><span class="type">void</span> QPainterPath::<span class="name">lineTo</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>)</h3>
<p>This is an overloaded function.</p>
<p>Draws a line from the current position to the point (<i>x</i>, <i>y</i>).</p>
<!-- @@@lineTo -->
<!-- $$$moveTo[overload1]$$$moveToconstQPointF& -->
<h3 class="fn" id="moveTo"><a name="moveTo"></a><span class="type">void</span> QPainterPath::<span class="name">moveTo</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>)</h3>
<p>Moves the current point to the given <i>point</i>, implicitly starting a new subpath and closing the previous one.</p>
<p><b>See also </b><a href="qpainterpath.html#closeSubpath">closeSubpath</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@moveTo -->
<!-- $$$moveTo$$$moveToqrealqreal -->
<h3 class="fn" id="moveTo-1"><a name="moveTo-1"></a><span class="type">void</span> QPainterPath::<span class="name">moveTo</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>)</h3>
<p>This is an overloaded function.</p>
<p>Moves the current position to (<i>x</i>, <i>y</i>) and starts a new subpath, implicitly closing the previous path.</p>
<!-- @@@moveTo -->
<!-- $$$percentAtLength[overload1]$$$percentAtLengthqreal -->
<h3 class="fn" id="percentAtLength"><a name="percentAtLength"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QPainterPath::<span class="name">percentAtLength</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>len</i>) const</h3>
<p>Returns percentage of the whole path at the specified length <i>len</i>.</p>
<p>Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations.</p>
<!-- @@@percentAtLength -->
<!-- $$$pointAtPercent[overload1]$$$pointAtPercentqreal -->
<h3 class="fn" id="pointAtPercent"><a name="pointAtPercent"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QPainterPath::<span class="name">pointAtPercent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>t</i>) const</h3>
<p>Returns the point at at the percentage <i>t</i> of the current path. The argument <i>t</i> has to be between 0 and 1.</p>
<p>Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations.</p>
<!-- @@@pointAtPercent -->
<!-- $$$quadTo[overload1]$$$quadToconstQPointF&constQPointF& -->
<h3 class="fn" id="quadTo"><a name="quadTo"></a><span class="type">void</span> QPainterPath::<span class="name">quadTo</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>c</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>endPoint</i>)</h3>
<p>Adds a quadratic Bezier curve between the current position and the given <i>endPoint</i> with the control point specified by <i>c</i>.</p>
<p>After the curve is added, the current point is updated to be at the end point of the curve.</p>
<p><b>See also </b><a href="qpainterpath.html#cubicTo">cubicTo</a>() and <a href="qpainterpath.html#composing-a-qpainterpath">Composing a QPainterPath</a>.</p>
<!-- @@@quadTo -->
<!-- $$$quadTo$$$quadToqrealqrealqrealqreal -->
<h3 class="fn" id="quadTo-1"><a name="quadTo-1"></a><span class="type">void</span> QPainterPath::<span class="name">quadTo</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>cx</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>cy</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>endPointX</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>endPointY</i>)</h3>
<p>This is an overloaded function.</p>
<p>Adds a quadratic Bezier curve between the current point and the endpoint (<i>endPointX</i>, <i>endPointY</i>) with the control point specified by (<i>cx</i>, <i>cy</i>).</p>
<!-- @@@quadTo -->
<!-- $$$reserve[overload1]$$$reserveint -->
<h3 class="fn" id="reserve"><a name="reserve"></a><span class="type">void</span> QPainterPath::<span class="name">reserve</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Reserves a given amount of elements in <a href="qpainterpath.html">QPainterPath</a>'s internal memory.</p>
<p>Attempts to allocate memory for at least <i>size</i> elements.</p>
<p>This function was introduced in Qt 5.13.</p>
<p><b>See also </b><a href="qpainterpath.html#clear">clear</a>(), <a href="qpainterpath.html#capacity">capacity</a>(), and <a href="../qtcore/qvector.html#reserve">QVector::reserve</a>().</p>
<!-- @@@reserve -->
<!-- $$$setElementPositionAt[overload1]$$$setElementPositionAtintqrealqreal -->
<h3 class="fn" id="setElementPositionAt"><a name="setElementPositionAt"></a><span class="type">void</span> QPainterPath::<span class="name">setElementPositionAt</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>)</h3>
<p>Sets the x and y coordinate of the element at index <i>index</i> to <i>x</i> and <i>y</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@setElementPositionAt -->
<!-- $$$setFillRule[overload1]$$$setFillRuleQt::FillRule -->
<h3 class="fn" id="setFillRule"><a name="setFillRule"></a><span class="type">void</span> QPainterPath::<span class="name">setFillRule</span>(<span class="type"><a href="../qtcore/qt.html#FillRule-enum">Qt::FillRule</a></span> <i>fillRule</i>)</h3>
<p>Sets the fill rule of the painter path to the given <i>fillRule</i>. Qt provides two methods for filling paths:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th ><a href="../qtcore/qt.html#FillRule-enum">Qt::OddEvenFill</a> (default)</th><th ><a href="../qtcore/qt.html#FillRule-enum">Qt::WindingFill</a></th></tr></thead>
<tr valign="top" class="odd"><td ><img src="images/qt-fillrule-oddeven.png" alt="" /></td><td ><img src="images/qt-fillrule-winding.png" alt="" /></td></tr>
</table></div>
<p><b>See also </b><a href="qpainterpath.html#fillRule">fillRule</a>().</p>
<!-- @@@setFillRule -->
<!-- $$$simplified[overload1]$$$simplified -->
<h3 class="fn" id="simplified"><a name="simplified"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">simplified</span>() const</h3>
<p>Returns a simplified version of this path. This implies merging all subpaths that intersect, and returning a path containing no intersecting edges. Consecutive parallel lines will also be merged. The simplified path will always use the default fill rule, <a href="../qtcore/qt.html#FillRule-enum">Qt::OddEvenFill</a>. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@simplified -->
<!-- $$$slopeAtPercent[overload1]$$$slopeAtPercentqreal -->
<h3 class="fn" id="slopeAtPercent"><a name="slopeAtPercent"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QPainterPath::<span class="name">slopeAtPercent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>t</i>) const</h3>
<p>Returns the slope of the path at the percentage <i>t</i>. The argument <i>t</i> has to be between 0 and 1.</p>
<p>Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations.</p>
<!-- @@@slopeAtPercent -->
<!-- $$$subtracted[overload1]$$$subtractedconstQPainterPath& -->
<h3 class="fn" id="subtracted"><a name="subtracted"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">subtracted</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>p</i>) const</h3>
<p>Returns a path which is <i>p</i>'s fill area subtracted from this path's fill area.</p>
<p>Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@subtracted -->
<!-- $$$swap[overload1]$$$swapQPainterPath& -->
<h3 class="fn" id="swap"><a name="swap"></a><span class="type">void</span> QPainterPath::<span class="name">swap</span>(<span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>)</h3>
<p>Swaps painter path <i>other</i> with this painter path. This operation is very fast and never fails.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@swap -->
<!-- $$$toFillPolygon[overload1]$$$toFillPolygonconstQTransform& -->
<h3 class="fn" id="toFillPolygon"><a name="toFillPolygon"></a><span class="type"><a href="qpolygonf.html">QPolygonF</a></span> QPainterPath::<span class="name">toFillPolygon</span>(const <span class="type"><a href="qtransform.html">QTransform</a></span> &amp;<i>matrix</i>) const</h3>
<p>Converts the path into a polygon using the <a href="qtransform.html">QTransform</a> <i>matrix</i>, and returns the polygon.</p>
<p>The polygon is created by first converting all subpaths to polygons, then using a rewinding technique to make sure that overlapping subpaths can be filled using the correct fill rule.</p>
<p>Note that rewinding inserts addition lines in the polygon so the outline of the fill polygon does not match the outline of the path.</p>
<p><b>See also </b><a href="qpainterpath.html#toSubpathPolygons">toSubpathPolygons</a>(), <a href="qpainterpath.html#toFillPolygons">toFillPolygons</a>(), and <a href="qpainterpath.html#qpainterpath-conversion">QPainterPath Conversion</a>.</p>
<!-- @@@toFillPolygon -->
<!-- $$$toFillPolygon$$$toFillPolygonconstQMatrix& -->
<h3 class="fn" id="toFillPolygon-1"><a name="toFillPolygon-1"></a><span class="type"><a href="qpolygonf.html">QPolygonF</a></span> QPainterPath::<span class="name">toFillPolygon</span>(const <span class="type"><a href="qmatrix.html">QMatrix</a></span> &amp;<i>matrix</i> = QMatrix()) const</h3>
<p>This is an overloaded function.</p>
<!-- @@@toFillPolygon -->
<!-- $$$toFillPolygons[overload1]$$$toFillPolygonsconstQTransform& -->
<h3 class="fn" id="toFillPolygons"><a name="toFillPolygons"></a><span class="type">QList</span>&lt;<span class="type"><a href="qpolygonf.html">QPolygonF</a></span>&gt; QPainterPath::<span class="name">toFillPolygons</span>(const <span class="type"><a href="qtransform.html">QTransform</a></span> &amp;<i>matrix</i>) const</h3>
<p>Converts the path into a list of polygons using the <a href="qtransform.html">QTransform</a> <i>matrix</i>, and returns the list.</p>
<p>The function differs from the <a href="qpainterpath.html#toFillPolygon">toFillPolygon</a>() function in that it creates several polygons. It is provided because it is usually faster to draw several small polygons than to draw one large polygon, even though the total number of points drawn is the same.</p>
<p>The toFillPolygons() function differs from the <a href="qpainterpath.html#toSubpathPolygons">toSubpathPolygons</a>() function in that it create only polygon for subpaths that have overlapping bounding rectangles.</p>
<p>Like the <a href="qpainterpath.html#toFillPolygon">toFillPolygon</a>() function, this function uses a rewinding technique to make sure that overlapping subpaths can be filled using the correct fill rule. Note that rewinding inserts addition lines in the polygons so the outline of the fill polygon does not match the outline of the path.</p>
<p><b>See also </b><a href="qpainterpath.html#toSubpathPolygons">toSubpathPolygons</a>(), <a href="qpainterpath.html#toFillPolygon">toFillPolygon</a>(), and <a href="qpainterpath.html#qpainterpath-conversion">QPainterPath Conversion</a>.</p>
<!-- @@@toFillPolygons -->
<!-- $$$toFillPolygons$$$toFillPolygonsconstQMatrix& -->
<h3 class="fn" id="toFillPolygons-1"><a name="toFillPolygons-1"></a><span class="type">QList</span>&lt;<span class="type"><a href="qpolygonf.html">QPolygonF</a></span>&gt; QPainterPath::<span class="name">toFillPolygons</span>(const <span class="type"><a href="qmatrix.html">QMatrix</a></span> &amp;<i>matrix</i> = QMatrix()) const</h3>
<p>This is an overloaded function.</p>
<!-- @@@toFillPolygons -->
<!-- $$$toReversed[overload1]$$$toReversed -->
<h3 class="fn" id="toReversed"><a name="toReversed"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">toReversed</span>() const</h3>
<p>Creates and returns a reversed copy of the path.</p>
<p>It is the order of the elements that is reversed: If a <a href="qpainterpath.html">QPainterPath</a> is composed by calling the <a href="qpainterpath.html#moveTo">moveTo</a>(), <a href="qpainterpath.html#lineTo">lineTo</a>() and <a href="qpainterpath.html#cubicTo">cubicTo</a>() functions in the specified order, the reversed copy is composed by calling <a href="qpainterpath.html#cubicTo">cubicTo</a>(), <a href="qpainterpath.html#lineTo">lineTo</a>() and <a href="qpainterpath.html#moveTo">moveTo</a>().</p>
<!-- @@@toReversed -->
<!-- $$$toSubpathPolygons[overload1]$$$toSubpathPolygonsconstQTransform& -->
<h3 class="fn" id="toSubpathPolygons"><a name="toSubpathPolygons"></a><span class="type">QList</span>&lt;<span class="type"><a href="qpolygonf.html">QPolygonF</a></span>&gt; QPainterPath::<span class="name">toSubpathPolygons</span>(const <span class="type"><a href="qtransform.html">QTransform</a></span> &amp;<i>matrix</i>) const</h3>
<p>Converts the path into a list of polygons using the <a href="qtransform.html">QTransform</a> <i>matrix</i>, and returns the list.</p>
<p>This function creates one polygon for each subpath regardless of intersecting subpaths (i.e&#x2e; overlapping bounding rectangles). To make sure that such overlapping subpaths are filled correctly, use the <a href="qpainterpath.html#toFillPolygons">toFillPolygons</a>() function instead.</p>
<p><b>See also </b><a href="qpainterpath.html#toFillPolygons">toFillPolygons</a>(), <a href="qpainterpath.html#toFillPolygon">toFillPolygon</a>(), and <a href="qpainterpath.html#qpainterpath-conversion">QPainterPath Conversion</a>.</p>
<!-- @@@toSubpathPolygons -->
<!-- $$$toSubpathPolygons$$$toSubpathPolygonsconstQMatrix& -->
<h3 class="fn" id="toSubpathPolygons-1"><a name="toSubpathPolygons-1"></a><span class="type">QList</span>&lt;<span class="type"><a href="qpolygonf.html">QPolygonF</a></span>&gt; QPainterPath::<span class="name">toSubpathPolygons</span>(const <span class="type"><a href="qmatrix.html">QMatrix</a></span> &amp;<i>matrix</i> = QMatrix()) const</h3>
<p>This is an overloaded function.</p>
<!-- @@@toSubpathPolygons -->
<!-- $$$translate[overload1]$$$translateqrealqreal -->
<h3 class="fn" id="translate"><a name="translate"></a><span class="type">void</span> QPainterPath::<span class="name">translate</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>dx</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>dy</i>)</h3>
<p>Translates all elements in the path by (<i>dx</i>, <i>dy</i>).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpainterpath.html#translated">translated</a>().</p>
<!-- @@@translate -->
<!-- $$$translate$$$translateconstQPointF& -->
<h3 class="fn" id="translate-1"><a name="translate-1"></a><span class="type">void</span> QPainterPath::<span class="name">translate</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>offset</i>)</h3>
<p>This is an overloaded function.</p>
<p>Translates all elements in the path by the given <i>offset</i>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpainterpath.html#translated">translated</a>().</p>
<!-- @@@translate -->
<!-- $$$translated[overload1]$$$translatedqrealqreal -->
<h3 class="fn" id="translated"><a name="translated"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">translated</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>dx</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>dy</i>) const</h3>
<p>Returns a copy of the path that is translated by (<i>dx</i>, <i>dy</i>).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpainterpath.html#translate">translate</a>().</p>
<!-- @@@translated -->
<!-- $$$translated$$$translatedconstQPointF& -->
<h3 class="fn" id="translated-1"><a name="translated-1"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">translated</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>offset</i>) const</h3>
<p>This is an overloaded function.</p>
<p>Returns a copy of the path that is translated by the given <i>offset</i>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qpainterpath.html#translate">translate</a>().</p>
<!-- @@@translated -->
<!-- $$$united[overload1]$$$unitedconstQPainterPath& -->
<h3 class="fn" id="united"><a name="united"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">united</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>p</i>) const</h3>
<p>Returns a path which is the union of this path's fill area and <i>p</i>'s fill area.</p>
<p>Set operations on paths will treat the paths as areas. Non-closed paths will be treated as implicitly closed. Bezier curves may be flattened to line segments due to numerical instability of doing bezier curve intersections.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qpainterpath.html#intersected">intersected</a>() and <a href="qpainterpath.html#subtracted">subtracted</a>().</p>
<!-- @@@united -->
<!-- $$$operator!=[overload1]$$$operator!=constQPainterPath& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QPainterPath::<span class="name">operator!=</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>path</i>) const</h3>
<p>Returns <code>true</code> if this painter path differs from the given <i>path</i>.</p>
<p>Note that comparing paths may involve a per element comparison which can be slow for complex paths.</p>
<p><b>See also </b><a href="qpainterpath.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator&[overload1]$$$operator&constQPainterPath& -->
<h3 class="fn" id="operator-and"><a name="operator-and"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">operator&amp;</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>) const</h3>
<p>Returns the intersection of this path and the <i>other</i> path.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpainterpath.html#intersected">intersected</a>(), <a href="qpainterpath.html#operator-and-eq">operator&amp;=</a>(), <a href="qpainterpath.html#united">united</a>(), and <a href="qpainterpath.html#operator-7c">operator|</a>().</p>
<!-- @@@operator& -->
<!-- $$$operator&=[overload1]$$$operator&=constQPainterPath& -->
<h3 class="fn" id="operator-and-eq"><a name="operator-and-eq"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;QPainterPath::<span class="name">operator&amp;=</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>)</h3>
<p>Intersects this path with <i>other</i> and returns a reference to this path.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpainterpath.html#intersected">intersected</a>(), <a href="qpainterpath.html#operator-and">operator&amp;</a>(), and <a href="qpainterpath.html#operator-7c-eq">operator|=</a>().</p>
<!-- @@@operator&= -->
<!-- $$$operator+[overload1]$$$operator+constQPainterPath& -->
<h3 class="fn" id="operator-2b"><a name="operator-2b"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">operator+</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>) const</h3>
<p>Returns the union of this path and the <i>other</i> path. This function is equivalent to operator|().</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpainterpath.html#united">united</a>(), <a href="qpainterpath.html#operator-2b-eq">operator+=</a>(), and <a href="qpainterpath.html#operator-">operator-</a>().</p>
<!-- @@@operator+ -->
<!-- $$$operator+=[overload1]$$$operator+=constQPainterPath& -->
<h3 class="fn" id="operator-2b-eq"><a name="operator-2b-eq"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;QPainterPath::<span class="name">operator+=</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>)</h3>
<p>Unites this path with <i>other</i>, and returns a reference to this path. This is equivalent to operator|=().</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpainterpath.html#united">united</a>(), <a href="qpainterpath.html#operator-2b">operator+</a>(), and <a href="qpainterpath.html#operator--eq">operator-=</a>().</p>
<!-- @@@operator+= -->
<!-- $$$operator-[overload1]$$$operator-constQPainterPath& -->
<h3 class="fn" id="operator-"><a name="operator-"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">operator-</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>) const</h3>
<p>Subtracts the <i>other</i> path from a copy of this path, and returns the copy.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpainterpath.html#subtracted">subtracted</a>(), <a href="qpainterpath.html#operator--eq">operator-=</a>(), and <a href="qpainterpath.html#operator-2b">operator+</a>().</p>
<!-- @@@operator- -->
<!-- $$$operator-=[overload1]$$$operator-=constQPainterPath& -->
<h3 class="fn" id="operator--eq"><a name="operator--eq"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;QPainterPath::<span class="name">operator-=</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>)</h3>
<p>Subtracts <i>other</i> from this path, and returns a reference to this path.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpainterpath.html#subtracted">subtracted</a>(), <a href="qpainterpath.html#operator-">operator-</a>(), and <a href="qpainterpath.html#operator-2b-eq">operator+=</a>().</p>
<!-- @@@operator-= -->
<!-- $$$operator==[overload1]$$$operator==constQPainterPath& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QPainterPath::<span class="name">operator==</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>path</i>) const</h3>
<p>Returns <code>true</code> if this painterpath is equal to the given <i>path</i>.</p>
<p>Note that comparing paths may involve a per element comparison which can be slow for complex paths.</p>
<p><b>See also </b><a href="qpainterpath.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
<!-- $$$operator|[overload1]$$$operator|constQPainterPath& -->
<h3 class="fn" id="operator-7c"><a name="operator-7c"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> QPainterPath::<span class="name">operator|</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>) const</h3>
<p>Returns the union of this path and the <i>other</i> path.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpainterpath.html#united">united</a>(), <a href="qpainterpath.html#operator-7c-eq">operator|=</a>(), <a href="qpainterpath.html#intersected">intersected</a>(), and <a href="qpainterpath.html#operator-and">operator&amp;</a>().</p>
<!-- @@@operator| -->
<!-- $$$operator|=[overload1]$$$operator|=constQPainterPath& -->
<h3 class="fn" id="operator-7c-eq"><a name="operator-7c-eq"></a><span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;QPainterPath::<span class="name">operator|=</span>(const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>other</i>)</h3>
<p>Unites this path with <i>other</i> and returns a reference to this path.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qpainterpath.html#united">united</a>(), <a href="qpainterpath.html#operator-7c">operator|</a>(), and <a href="qpainterpath.html#operator-and-eq">operator&amp;=</a>().</p>
<!-- @@@operator|= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<$$$operator<<QDataStream&constQPainterPath& -->
<h3 class="fn" id="operator-lt-lt-19"><a name="operator-lt-lt-19"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&lt;&lt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>stream</i>, const <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>path</i>)</h3>
<p>Writes the given painter <i>path</i> to the given <i>stream</i>, and returns a reference to the <i>stream</i>.</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>[overload1]$$$operator>>QDataStream&QPainterPath& -->
<h3 class="fn" id="operator-gt-gt"><a name="operator-gt-gt"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&gt;&gt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>stream</i>, <span class="type"><a href="qpainterpath.html#QPainterPath">QPainterPath</a></span> &amp;<i>path</i>)</h3>
<p>Reads a painter path from the given <i>stream</i> into the specified <i>path</i>, and returns a reference to the <i>stream</i>.</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
